package com.gong.gongcloudpicture1.exception;

import lombok.Data;

@Data
public class BusinessException extends RuntimeException {


    private ErrorCode errorCode;
    private Object[] args;
    private Integer code;
    private String message;


    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
    }


    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.message = msg;
    }

    public BusinessException(ErrorCode errorCode, String msg) {
        super(msg);
        this.code = errorCode.getCode();
        this.message = msg;
    }


}
